package com.zlsy.es.dianping.mapper;

import com.zlsy.es.dianping.base.MyMapper;
import com.zlsy.es.dianping.pojo.dto.ShopDTO;
import com.zlsy.es.dianping.pojo.model.Shop;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface ShopMapper extends MyMapper<Shop> {

    Integer countAllShop();

    List<ShopDTO> recommendDTO(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude);

    List<Shop> recommend(@Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude);

    List<Shop> search(@Param("longitude") BigDecimal longitude,
                      @Param("latitude") BigDecimal latitude,
                      @Param("keyword") String keyword,
                      @Param("orderby") Integer orderby,
                      @Param("categoryId") Integer categoryId,
                      @Param("tags") String tags);

    List<ShopDTO> searchDTO(@Param("longitude") BigDecimal longitude,
                            @Param("latitude") BigDecimal latitude,
                            @Param("keyword") String keyword,
                            @Param("orderby") Integer orderby,
                            @Param("categoryId") Integer categoryId,
                            @Param("tags") String tags);

    List<Map<String, Object>> searchGroupByTags(@Param("keyword") String keyword,
                                                @Param("categoryId") Integer categoryId,
                                                @Param("tags") String tags);
}